package rmmk.ntp4;

import java.util.ArrayList;
import java.util.List;

public class River {

	List<CanoeRentalPoint> rentalPoints = new ArrayList<>();

	public List<CanoeRentalPoint> getRentalPoints() {
		return rentalPoints;
	}

	public void setRentalPoints(List<CanoeRentalPoint> rentalPoints) {
		this.rentalPoints = rentalPoints;
	}
	
	public River addRentalPoint(CanoeRentalPoint crp)
	{
		this.rentalPoints.add(crp);
		return this;
	}
	
	public void calculateCost(ICalculateCost icc)
	{
		icc.calculate(getRentalPoints());
		
		int cost = rentalPoints.get(0).getCost() * (rentalPoints.size() -1);
		
		System.out.println("Koszt przejazdu pierwszym kajakiem do końca trasy: " + cost);
	}
}
